//package mhyx2.config;
//
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
//import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
//import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
//
///**
// * Created with IntelliJ IDEA.
// *
// * @User: c.c
// * @Date: 2022/6/13
// * @Time: 16:46
// * @Description: 资源放行
// */
//
//@Configuration
//@EnableResourceServer
//public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
//
//    @Override
//    public void configure(ResourceServerSecurityConfigurer resources) {
//
//        resources.resourceId("hello") // 配置资源id，这里的资源id和授权服务器中的资源id一致
//                .stateless(true); // 设置这些资源仅基于令牌认证
//    }
//
//    // 配置 URL 访问权限
//    @Override
//    public void configure(HttpSecurity http) throws Exception {
//        http.authorizeRequests()
//                .antMatchers("/admin/**").hasRole("admin")
//                .antMatchers("/role1/**").hasRole("role1")
//                .anyRequest().authenticated();
//    }
//
//}
